/**
 * 路由配置文件
 */


import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
import store from '../../vuex/index'


Vue.use(VueRouter)

const router = new VueRouter({
    // mode: 'history',
    // base: 'view',
    routes
});

/*router.beforeEach((to, from, next) => {

    if (to.matched.some(record => record.meta.requiresAuth)) {

        if (to.matched.some(record => record.meta.hideOptionMenu) && wx) {
            wx.hideOptionMenu();
        }else{
            wx.showOptionMenu();
        }

        if( store.state.account.loginIn ){
            next();
        }else{
            store.dispatch('getAccount', {
                callback_url: '/' + router.options.base + to.fullPath,
                scope: to.meta.scope,
                key: to.meta.key===0?to.meta.key:1,
                cbk: function () {
                    next();
                }
            });
        }

    }else{
        next();
    }

});*/

export default router

